
	<h1><?php echo $this->lang->line('gallery_title'); ?></h1>
	<form action="<?php echo admin_url();?>/gallery" method="post" >
	    <div class="toppage">
	    	<span class="left">
	            <?php if(count($cate_info)>0){?>
                	<select name="category" class="" style="width: 150px;" >
                		<option value="all"><?php echo $this->lang->line('all'); ?></option>
                		<?php foreach($cate_info as $leaf) {?>
						<option value="<?php echo $leaf->id;?>" <?php echo ($leaf->id == $cate)?"selected": ""; ?> >
							<?php
								echo $leaf->name;
							?>
						</option>
					<?php }?>
                	</select>
            	<?php }?>
	        	<input type="submit" name="" value="<?php echo $this->lang->line('filter'); ?>" class="btn" />
	        </span>
	       
	        <span class="btnadd">
	        	<a onclick="open_form('<?php echo admin_url(); ?>/add-new-gallery')" href="javascript:void(0)"><?php echo $this->lang->line('add'); ?></a>
	        </span>
	    </div>
    </form>
     <form action="<?php echo admin_url();?>/gallery" method="post" id="list-gallery-form">
	     <div class="topart">
	    	<span class="left">
	    		<?php 
	    			$total_amount	=	$this->gallery_model->count_all();
	    		?>
	    		<font class="number">(<?php echo $total_amount;?>)</font>
	    		<a href="javascript:void(0);"><?php echo $this->lang->line('all'); ?></a>
	        </span>
	        <span class="right1">
	        	<select style="width:50px;" name="perpage" id="perpage" onchange="changePageNumber()">
	            	<option value="6" <?php echo ($current_perpage==6)?'selected':'';?>>6</option>
	                <option value="12" <?php echo ($current_perpage==12)?'selected':'';?>>12</option>
	                <option value="24" <?php echo ($current_perpage==24)?'selected':'';?>>24</option>
	                <option value="all" <?php echo ($current_perpage=='all')?'selected':'';?>><?php echo $this->lang->line('all'); ?></option>
	            </select>
	            <div class="pagination">
	                <?php if(isset($pagination)){echo $pagination;}?>
	            </div>
		    </span>
	    </div>
    </form>
    <div class="tableout">
    	<form action="<?php echo admin_url();?>/gallery" method="post" id="action_gallery_form">
			<div class="title1">
	        	<div class="column" style="width: 2%;"><input class="check_all" onclick="check_all('.check_all')" type="checkbox"></div>
	            <div class="column" style="width: 4%;"><?php echo $this->lang->line('number'); ?></div>
	            <div class="column" style="width: 25%;"><?php echo $this->lang->line('title'); ?></div>
	            <div class="column" style="width: 25%;"><?php echo $this->lang->line('parent'); ?></div>
	            <div class="column" style="width: 25%;"><?php echo $this->lang->line('thumbnail'); ?></div>
	            <div class="column" style="width: 15%;"><?php echo $this->lang->line('date'); ?></div>
	        </div>
	        <?php if(count($gallery_list[0])>0){?>
	        <?php foreach ($gallery_list as $k => $v){?>
	        <div class="linecate2">
	        	<div class="column" style="width: 2%;"><input name="id[]" value="<?php echo $v->id;?>" type="checkbox" /></div>
	            <div class="column" style="width:4%;"><?php echo $k+1;?></div>
	            
	            <div id="row_<?php echo $v->id;?>">
		            <div class="column" style="width:25%;" onmouseover="Hovercat('<?php echo $v->id;?>')" onmouseout="Outcat('<?php echo $v->id;?>')">
		            	<a href="javascript:;" class="art ">
		            		<?php 
    							$content = $v->title;
		            			$content = strip_tags($content);
		            			if(strlen($content) > 40){
		            				$content = substr($content,0,40);
		            				$posw=strrpos($content," ");
		            				if($posw > 0)$content = substr($content,0,$posw);
		            				echo $content.'...';
		            			}else {
		            				echo $content;
		            			}
		            		?>
		            	</a><br />
		                <div class="action" id="neocat-<?php echo $v->id;?>">
		                    <img src="<?php echo base_url();?>public/admin/img/edit.gif" /><a href="javascript:void(0)" onclick="open_form('<?php echo admin_url(); ?>/edit-gallery/<?php echo $v->id;?>')"><?php echo $this->lang->line('edit'); ?></a>|<img src="<?php echo base_url();?>public/admin/img/delete.gif" /><a href="<?php echo admin_url();?>/delete-gallery/<?php echo $v->id;?>" onclick="return confirm('<?php echo $this->lang->line('delete_conf'); ?>');"><font color="#be0000"><?php echo $this->lang->line('delete'); ?></font></a>
		                </div>
		            </div>
		            <div class="column" style="width:25%;">
		            	<span><?php echo $v->parent_name;?></span>
		            </div>
		            <div class="column small_thumb " style="width:25%; padding: 5px 0px 0px 0px;">
		            	<img src="<?php if(file_exists($v->image_url)){echo base_url().$v->image_url;}else{echo img_link('no_image.gif','admin');}?>"  height="35"  />
	            		<div class="fullsize_thumb">
							<img  src="<?php if(file_exists($v->image_url)){echo base_url().$v->image_url;}else{echo img_link('no_image.gif','admin');}?>"  style="border:0px; width: 150px;"  alt="" title=""/>
						</div>
		            </div>
		            
		            <div class="column" style="width:15%;">
		            	<span><?php echo $v->date_created;?></span>
		            </div>
		            
	            </div>
	        </div>
	        <?php }?>
	        <?php }else{?>
	        	<p style="padding: 10px;font-size: 16px; font-style: italic; color: green;" ><?php echo $this->lang->line('no_results'); ?></p>
	        <?php }?>
	        <div class="bottom1">
	             <span class="right1">
	                <div class="pagination">
	                	<?php if(isset($pagination)){echo $pagination;}?>
	            	</div>
	            </span>
	        </div>
        </form>
	</div>
	
<script type="text/javascript">
	function changePageNumber() {
		$("#list-gallery-form").submit();
	}
	var inform	=	'<?php echo $inform;?>';
	if(inform == 'delete gallery success') {alert("<?php echo $this->lang->line('delete_mess'); ?>");}

</script>
